"use strict";
import * as React from 'react';
const { View, Text, StyleSheet, TouchableOpacity } = require('react-native');
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import MyBadge from "./MyBadge";
const glyphMap = require('./iconfont.json');
const IconSet = createIconSet(glyphMap, 'iconfont', 'iconfont.ttf');
export default class MyIcon extends React.Component {
    render() {
        const { style, badgeNumber, } = this.props;
        if (this.props.onPress) {
            return (<TouchableOpacity onPress={this.props.onPress} style={style}>
                    <MyBadge number={badgeNumber}>
                        <IconSet {...this.props} style={style}/>
                    </MyBadge>
                </TouchableOpacity>);
        }
        return (<MyBadge number={badgeNumber}>
                <IconSet {...this.props} style={style}/>
            </MyBadge>);
    }
}
MyIcon.defaultProps = {
    size: 20,
    color: '#ccc',
    name: '',
    onPress: null,
    badgeNumber: 0
};
const styles = StyleSheet.create({
    container: {
        display: 'flex',
        flex: 1,
        backgroundColor: '#efefef'
    }
});
